' Function to concatenate two parts of a path, adding a '\' if necessary
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
ENDIF
END FUNCTION
' Max function
FUNCTION Max (a&, b&) STATIC AS LONG
IF a& > b& THEN
Max = a&
ELSE
Max = b&
ENDIF
END FUNCTION
' Subroutine to do the actual file copying
SUB CopyFiles STATIC
ClearCopyList
AddFiles ROOTFILES, 1
IF GetListItem(CHECKSTATES$, RUNTIME) = "ON" THEN
IF GetListItem(CHECKSTATES$, LOCALIZE) = "OFF" OR (GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND DEFLANG$ = "1") THEN
AddFiles USARUNTIMEFILES, 1
ELSEIF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND DEFLANG$ = "2" THEN
AddFiles FRNRUNTIMEFILES, 1
ELSEIF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND DEFLANG$ = "3" THEN
AddFiles GERRUNTIMEFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND INSTALL$ = "1" THEN
AddFiles LOCALRUNTIMEFILES, 1
ENDIF
ENDIF
IF GetListItem(CHECKSTATES$, AUTHOR) = "ON" THEN
AddFiles AUTHORFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, SONY) = "ON" THEN
AddFiles SONYFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, HELP) = "ON" THEN
IF GetListItem(CHECKSTATES$, LOCALIZE) = "OFF" OR (GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "1"))) THEN
AddFiles USAHELPFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "2")) THEN
AddFiles FRNHELPFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "3")) THEN
AddFiles GERHELPFILES, 1
ENDIF
ENDIF
IF GetListItem(CHECKSTATES$, PROGSAMPLE) = "ON" THEN
AddFiles PROGSAMPLEFILES, 1
IF GetListItem(CHECKSTATES$, LOCALIZE) = "OFF" OR (GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "1"))) THEN
AddFiles PROGSAMPLEFILESUSA, 1
ENDIF
IF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "2")) THEN
AddFiles PROGSAMPLEFILESFRN, 1
ENDIF
IF GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "3")) THEN
AddFiles PROGSAMPLEFILESGER, 1
ENDIF
ENDIF
IF GetListItem(CHECKSTATES$, WINSAMPLE) = "ON" THEN
AddFiles WINSAMPLEFILES, 1
ENDIF
IF GetListItem(CHECKSTATES$, SONYSAMPLE) = "ON" THEN
AddFiles SONYSAMPLEFILES, 1
ENDIF
CopyFilesInCopyList
END SUB
' Subroutine to find the sizes for each copy option
IF GetListItem(CHECKSTATES$, LOCALIZE) = "OFF" OR (GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "1"))) THEN
IF GetListItem(CHECKSTATES$, LOCALIZE) = "OFF" OR (GetListItem(CHECKSTATES$, LOCALIZE) = "ON" AND (INSTALL$ = "1" OR (INSTALL$ = "2" AND DEFLANG$ = "1"))) THEN